// 加载路由模块
import { createRouter,createWebHashHistory } from "vue-router"

import DefaultPage from "@/views/DefaultPage/DefaultPage.vue";
import SingFilePage from "@/views/SingFilePage/SingFilePage.vue";
import FileModePage from "@/views/FileModePage/FileModePage.vue";
import ErrorPage from "@/views/ErrorPage/ErrorPage.vue";
import StylePage from "@/views/StylePage/StylePage.vue";
import BuildPage from "@/views/BuildPage/BuildPage.vue";
import AjaxPage from "@/views/AjaxPage/AjaxPage.vue";
import RoutePage from "@/views/RoutePage/RoutePage.vue";
import ElementUIPage from "@/views/ElementUIPage/ElementUIPage.vue";

// 创建路由对象
const router = createRouter({
    // 定义路由模式
    history:createWebHashHistory(),
    // 路由表配置
    //      将需要通过路由组件为页面RouterView提供页面显示的组件进行定义描述
    //      同时实现路由页面组件和URL地址的配置映射关系
    routes:[
        {
            // 定义路由页面组件的地址
            path:"/default",
            // 定义路由页面对应的vue组件
            component:DefaultPage
        },
        {
            path:"/sing",
            component:SingFilePage
        },
        {
            path:"/file",
            component:FileModePage
        },
        {
            path:"/error",
            component:ErrorPage
        },
        {
            path:"/style",
            component:StylePage
        },
        {
            path:"/build",
            component:BuildPage
        },
        {
            path:"/ajax",
            component:AjaxPage
        },
        {
            path:"/route",
            component:RoutePage
        },
        {
            path:"/element",
            component:ElementUIPage
        },
    ]
})

// 输出路由对象=>路由对象带有install函数，是vue应用的一个插件对象
export default router;